<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:include href="../users/ownerBar.xsl" />

	<xsl:template match="object[@type='photoalbum']" mode="album-bar">
		<xsl:apply-templates select="document(concat('xmodule://users/getUser/', property[@name='owner_id']/value))/data/response/object[@type='user']" mode="ownerbar" />
		
		<div class="photoalbum-bar">
			<xsl:if test="$userId = property[@name='owner_id']/value">
				<div class="controls">
					<span class="edit">
						<a href="{$baseURI}/photos/edit_album/{@id}">редактировать альбом</a>
					</span>
					<span class="g-button">
						<a href="{$baseURI}/photos/upload/{@id}">Добавить фотографии</a>
					</span>
				</div>
			</xsl:if>
			
			<div class="title">
				<xsl:text>Фотоальбом «</xsl:text>
				<a href="{$baseURI}/photoalbum/{@id}">
					<xsl:value-of select="property[@name='title']/value" />
				</a>
				<xsl:text>»</xsl:text>
			</div>
		</div>
	</xsl:template>
		
</xsl:stylesheet>	